package org.example.test.mapper;

import org.apache.ibatis.annotations.*;
import org.example.test.entity.Project;

import java.util.List;

@Mapper
public interface ProjectMapper {
    @Select("select * from test.project where project_name like '%${projectName}%'")
    List<Project> findAll( String projectName);

    @Delete("delete  from test.project where project_id = #{projectId}")
    int delete(Integer projectId);
    @Update("update test.project set project_id = #{projectId},project_name = #{projectName},project_start_time = #{projectStartTime},project_end_time = #{projectEndTime} where project_id=#{projectId}")
    int update(Project project);
    @Insert("INSERT into test.project(project_id,project_name,project_start_time,project_end_time)values " +
            "(#{projectId},#{projectName},#{projectStartTime},#{projectEndTime})")
    int add(Project project);
}
